---
sidebar_label: Rename relationships
sidebar_position: 2
description: Rename BigQuery relationships in Hasura
keywords:
  - hasura
  - docs
  - bigquery
  - schema
  - relationship
  - rename
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# BigQuery: Rename Relationships

An existing relationship can be renamed as follows:

<Tabs groupId="user-preference" className="api-tabs">
<TabItem value="console" label="Console">

- Head to `Data -> [table-name] -> Relationships` in the Console
- Drop the existing relationship
- Recreate the relationship with the new name

</TabItem>

<TabItem value="api" label="API">

<!-- TODO: BigQuery Metadata docs: https://github.com/hasura/graphql-engine/issues/8560  -->

You can rename a relationship by using the
[bigquery_rename_relationship](/api-reference/metadata-api/relationship.mdx#metadata-bq-rename-relationship) metadata
API:

```http
POST /v1/metadata HTTP/1.1
Content-Type: application/json
X-Hasura-Role: admin

{
  "type": "bigquery_rename_relationship",
  "args": {
    "source": "<db_name>",
    "dataset": "bigquery",
    "table": "articles",
    "name": "article_details",
    "new_name": "article_detail"
  }
}
```

</TabItem>
</Tabs>

:::info Note

You might not be allowed to drop a relationship if it has been referenced elsewhere (e.g. in a permissions rule).

In this case you will have to delete the references first, rename the relationship, and then re-add the references.

:::
